<?php
namespace Tbf\Component\Io;
//将字符串流式写入文件,每次write均写入并close,(不用调用close)
class FileStringWriter implements StringWriterInterface{
    protected $file_name;
    public function __construct($file_name){
        $this->file_name = $file_name;
    }
    /**
     * 写入一些字符串
     * @param  string $string
     * @return string 错误
     */
    public function write($string)
    {
        file_put_contents($this->file_name,$string,FILE_APPEND);
    }

}